﻿using System.Collections.Generic;
using LinqToAmazonSL.AWS;
using System.Linq.Expressions;


namespace LinqToAmazonSL
{
    //Abstract class to handle the search criterion
    public abstract class AmazonQueryCriteria
    {
        public Dictionary<string, QueryValue> Parameters { get; set; }
        public SearchIndex SearchIndex { get; set; }
        //We save on this stack the list of the operations to perform to the query
        public Stack<Operations> OperationsStack;
        public LambdaExpression Selector { get; set; }

        public abstract AmazonQueryCriteria ClearCriteria();
        public abstract ItemSearchRequest[] ToAmazonRequest();
    }

    //Class to store an operation and a value applied to a search query
    public class Operations
    {
        public Oper Oper { get; set; }
        public string Value { get; set; }

        public Operations(Oper op, string val)
        {
            Oper = op;
            Value = val;
        }
    }
}
